package com.orange.common.exception;

import com.orange.common.enums.ResultCodeEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 * 工具类调用异常错误信息
 *
 * @Author YWF
 * @Date 2022/1/13 11:10
 */
public class InvokeException extends RuntimeException {

    private final static Logger logger = LoggerFactory.getLogger(InvokeException.class);

    private String code;

    public InvokeException(String msg){
        super(msg);
        this.code = ResultCodeEnum.ERROR_CODE_BIZ.getCode();
    }

    public InvokeException(String msg,String code){
        super(msg);
        this.code = code;
    }

    public InvokeException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMsg());
        this.code = resultCodeEnum.getCode();
    }

    public String getCode() {
        return code;
    }

}
